package main
import(
	"fmt"
)
type Person struct{
	name string;
	age int;
	gender string
}
//类型名和成员变量名  小写则是私有  大写则为公有
type person struct{
	Name string;
	Age int;
	Gender string
}

func main(){
	var person1 Person
	person1.name="zhangsan"
	person1.age=18
	person1.gender="male"

	fmt.Println(person1)
	fmt.Printf("%T  %#v\n",person1,person1)

	p1:=new(person)
	p1.Name="lisi"//(*p).Name
	p1.Age=12//(*p1).Age
	p1.Gender="female"

	fmt.Println(p1)
	fmt.Printf("%T  %#v\n",p1,p1)

	p2:=&Person{}
	p2.name="关羽"
	p2.age=34
	p2.gender="male"
	fmt.Printf("%T %#v\n",p2,p2)

	p3:=Person{
		name:"刘备",
		age:67,
		gender:"male",
	}
	fmt.Printf("%T %#v\n",p3,p3)

	p4:=&Person{
		name:"张飞",
		age:19,
		gender:"male",
	}
	fmt.Printf("%T %#v\n",p4,p4)
}
